//package invest.strategy.impl;
//
//import invest.data.DataEnum;
//import invest.data.DataFactory;
//import invest.pojo.ToSendRecord;
//import invest.pojo.datapojo.ConvertibleBond;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.text.ParseException;
//import java.util.List;
//
//@Component
//public class LowPriceConvertibleDebt extends AbstractStrategy {
//    DataFactory dataFactory = new DataFactory();
//    @Override
//    protected void setMail() {
//        mail.setSubject("低价转债");
//        mail.setContent("低价转债买入");
//    }
//
//    @Override
//    public synchronized boolean analyzeStrategy() throws ParseException, IOException {
//        Boolean flag=false;
//        List<ConvertibleBond> convertibleBondList = (List<ConvertibleBond>) dataFactory.getData(DataEnum.CONVERTABLE_BOND_REALTIME);
//        for (ConvertibleBond convertibleBond :
//                convertibleBondList) {
//            Float stockIncrease = StringtoFloat(convertibleBond.getSincreaseRt());
//            Float debtIncrease = StringtoFloat(convertibleBond.getIncreaseRt());
//            Float debtPrice = StringtoFloat(convertibleBond.getPrice());
//            Float yijialv = StringtoFloat(convertibleBond.getPremiumRt().substring(0, convertibleBond.getPremiumRt().length() - 1))/100;
//            if ((debtPrice < 87) || (debtPrice < 91 && yijialv < 0.2)) {
//                ToSendRecord record = new ToSendRecord();
//                record.setName(convertibleBond.getBondNm());
//                record.setMessage("转债价格："+debtPrice+"  溢价率："+yijialv);
//                this.setToSendTarget(record);
//                flag = true;
//            }
//        }
//        return flag;
//    }
//}
